<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupFrame</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupFrame</h2>

  <p>
  Creates a 
  native container, which draws a frame with 
  a title around its child.</p>

<h3><a name="Creation">Creation</a></h3>
<pre>Ihandle* IupFrame(Ihandle *<strong>child</strong>); [in C]
iup.frame{<strong>child</strong>: ihandle} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
frame(<strong>child</strong>) [in LED]</pre>
  <p><strong>child</strong>: Identifier of an interface element which will 
  receive the frame around. It can be NULL (nil in Lua), or empty in LED.</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p>
<a href="../attrib/iup_bgcolor.html">BGCOLOR</a>: ignored, transparent in all 
systems. Will use the background color of the native parent. Except if TITLE is 
not defined and BGCOLOR is defined before map (can be changed later), then the frame will have a color 
background.</p>
<p><strong>CHILDOFFSET</strong>: Allow to specify a position offset for the 
child. Available for native containers only. It will not affect the natural 
size, and allows to position controls outside the client area. Format &quot;<em>dx</em>x<em>dy</em>&quot;,
  where <em>dx</em> and <em>dy</em> are integer values corresponding to the horizontal and vertical 
offsets, respectively, in pixels. Default: 0x0. (since 3.14)</p>

<p><a href="../attrib/iup_expand.html">EXPAND</a> (<font SIZE="3">non inheritable</font>):
  The default value is &quot;YES&quot;.</p>

  <p><a href="../attrib/iup_fgcolor.html">FGCOLOR</a>: Text title color. Not 
	available in Windows when using Windows Visual Styles. Default: the global 
	attribute DLGFGCOLOR.</p>
  <p><b>SUNKEN</b>: When not using a title, the frame line defines a 
  sunken area (lowered area). Valid values: YES or
  NO<i>.</i> Default:
  NO.</p>
  <p><a href="../attrib/iup_title.html">TITLE</a> (<font SIZE="3">non inheritable</font>):
  Text the user will see at the top of the 
  frame. If not defined during creation it can not be added lately, to be changed it must be at least &quot;&quot; during 
  creation. </p>
  <blockquote>
  <hr>
</blockquote>
<p>
<a href="../attrib/iup_active.html">ACTIVE</a>,
<a href="../attrib/iup_font.html">FONT</a>, <a href="../attrib/iup_screenposition.html">SCREENPOSITION</a>, 
<a href="../attrib/iup_position.html">
POSITION</a>, 
<a href="../attrib/iup_clientsize.html">CLIENTSIZE</a>, 
	<a href="../attrib/iup_clientoffset.html">CLIENTOFFSET</a>, 
	<a href="../attrib/iup_minsize.html">
MINSIZE</a>, <a href="../attrib/iup_maxsize.html">
MAXSIZE</a>,
    <a href="../attrib/iup_wid.html">WID</a>, <a href="../attrib/iup_size.html">SIZE</a>, 
<a href="../attrib/iup_rastersize.html">RASTERSIZE</a>,
    <a href="../attrib/iup_zorder.html">ZORDER</a>, <a href="../attrib/iup_visible.html">VISIBLE</a>,
<a href="../attrib/iup_theme.html">THEME</a>: 
also accepted.</p>

<h3><a name="Callbacks">Callbacks</a></h3>

<p> 
<a href="../call/iup_map_cb.html">MAP_CB</a>, 
<a href="../call/iup_unmap_cb.html">UNMAP_CB</a>,
<a href="../call/iup_destroy_cb.html">DESTROY_CB</a>:  common callbacks are 
supported.</p>

  
<p><b><a name="FOCUS_CB">FOCUS_CB</a></b>: Called when a child of the container gets or looses the focus. It is called 
  only if PROPAGATEFOCUS is defined in the child. (since 3.23)</p>

  
    
<pre>int function(Ihandle *<b>ih</b>, int <b>focus</b>); [in C]<br><b>ih</b>:focus_cb(<b>focus</b>: number) -&gt; (ret: number) [in Lua]</pre>

    
<p class="info"><strong>ih</strong>:
  identifier of the element that activated the 
  event.<br>

    <strong>focus</strong>: is non zero if the canvas is getting the focus, is zero 
    if it is loosing the focus.</p>

  

  
<h3><a name="Notes">Notes</a></h3>

<p>
  In Windows, a Frame with TITLE==NULL is not the same control as then 
	TITLE!=NULL. When TITLE==NULL it does not have Visual Styles and uses a 
	sharp rectangle border. When TITLE!=NULL it has Visual Styles and the border 
	is a rounded rectangle. To always use Visual Styles set the title to &quot;&quot; 
	before mapping, but be aware that a vertical space for the title will be 
	always reserved at the top border.</p>

<p>The frame can be created with no elements and be dynamic filled using
  <a href="../func/iupappend.html">IupAppend</a> or
<a href="../func/iupinsert.html">IupInsert</a>.&nbsp;</p>

<p> In GTK uses GtkFrame, in Windows uses WC_BUTTON, and 
in Motif uses xmFrame.</p>


<h3><a name="Examples">Examples</a></h3>
<p><a href="../../examples/">Browse for Example Files</a></p>

<pre>
  frame1 = IupFrame
          (
            IupVbox
            (
              IupLabel("Label1"),
              IupLabel("Label2"), 
              IupLabel("Label3"),
              NULL
            )
          );

  frame2 = IupFrame
          (
            IupVbox
            (
              IupLabel("Label4"), 
              IupLabel("Label5"),
              IupLabel("Label6"),
              NULL
            )
          );

  IupSetAttribute(frame1, "TITLE", "Title Text");
  IupSetAttribute(frame2, "SUNKEN", "YES");
</pre>
<div align="center">
  <center>
  <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1">
    <tr>
      <th>Windows Classic</th>
    </tr>
    <tr>
      <td class="bg_win2k"><img border="0" src="images/iupframe_win2k.png"></td>
    </tr>
    <tr>
      <th>Windows w/ Styles</th>
    </tr>
    <tr>
      <td class="bg_winxp"><img border="0" src="images/iupframe_winxp.png"></td>
    </tr>
    <tr>
      <th>Motif</th>
    </tr>
    <tr>
      <td class="bg_mot"><img border="0" src="images/iupframe_mot.png"></td>
    </tr>
    <tr>
      <th>GTK</th>
    </tr>
    <tr>
      <td class="bg_gtk"><img border="0" src="images/iupframe_gtk.png"></td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>